(function (window,undefined) {
    // 工具对象
    var Tools = {
        // 生成指定范围的随机整数
        getRandom: function (min, max) {
            return Math.floor(Math.random() * (max - min + 1)) + min;
        },
        // 对象拷贝
        extend: function (parent, child) {
            for (var key in parent) {
                if (child[key]) {
                    continue;
                }
                child[key] = parent[key];
            }
        },
        //自定义提示框
        alert:function(msg){
            var div=document.createElement('div');
            div.style.position='absolute';
            div.style.width='120px';
            div.style.height="40px";
            div.style.lineHeight="40px";
            div.style.margin='auto';
            div.style.top='0px';
            div.style.bottom='0px';
            div.style.left='0px';
            div.style.right='0px';
            div.style.textAlign='center';
            div.style.color='#FFF';
            div.style.borderRadius='4px';
            div.style.background="rgba(0,0,0,0.8)";
            document.getElementById('container').appendChild(div);
            var textNode=document.createTextNode(msg);
            div.appendChild(textNode);
        }
    }
    


    window.Tools = Tools;
})(window,undefined);